//
//  MLField.m
//  UITest
//
//  Created by user on 2017/5/24.
//  Copyright © 2017年 xbs. All rights reserved.
//

#import "MLField.h"
#import <objc/runtime.h>

@implementation MLField




- (void)layoutSubviews{
    
    [super layoutSubviews];
    
    
    self.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;

     UILabel *placeholderLabel = [self valueForKey:@"placeholderLabel"];

      placeholderLabel.center = self.center;
    placeholderLabel.frame = self.bounds;
    
    
}

- (void)drawTextInRect:(CGRect)rect{
    
    [super drawTextInRect:rect];
    
    [self.text drawInRect:rect withFont:self.font lineBreakMode:NSLineBreakByCharWrapping alignment:NSTextAlignmentCenter];
    
    NSLog(@"drawTextInRect");
    
}

@end
